import { reactive } from 'vue';

function useRemoveStudent() {
    let state = reactive({
        stus: [{
            id: 1,
            name: 'zby',
            thing: '打篮球'
        }, {
            id: 2,
            name: 'yds',
            thing: '踢足球'
        }, {
            id: 3,
            name: 'gch',
            thing: '打排球'
        }]
    });

    function remove(id) {
        state.stus = state.stus.filter((item, index) => index !== id)
    }
    return { state, remove }
}

export default useRemoveStudent